#pragma once
#include <Windows.h>
#include <thread>
#include <atomic>

using namespace std;

class HighPrecisionTimer
{
	public:
	HighPrecisionTimer() {};
	~HighPrecisionTimer() {};

	public:
	LARGE_INTEGER tick, ltick, freq;
	atomic<double> elapsed;
	double checkpoint = 0;
	bool isRunning = false;
	bool isPaused = false;
	thread* tloop;

	public:
	void start();
	void pause();
	void resume();
	void reset();
	void stop();
	void loop();
	void setcheckpoint();
	float getElapsed();
	float getElapsedReset();
	float getElapsedFromCheckpoint();
};